<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            width: 500px;
            height: 300px;
            background-color: pink;

            background-image: url(./images/1.png);
            background-repeat: no-repeat;
            /* 如果图片宽或者高和盒子一样就会停止缩放,可能会留白 */
            background-size: contain;
            /* 完全覆盖,可能会图片不全 */
            background-size: cover;
            background-size: 100%;
        }
    </style>
</head>
<body>
    <div>div 标签</div>
</body>
</html>